<?php

/**
 *    卖家退货退款管理控制器
 *
 *    @author   yanghj 2014-08-1
 *    @usage    none
 */
class Seller_returnsApp extends StoreadminbaseApp
{
    var $_order_mod;
    var $_order_extm_mod; 
	var $_order_goods_mod;
	var $_order_log_mod;
	var $_returns_mod;
    var $_returns_log_mod;
    var $_user_safety_mod;
    var $_address_mod;
    var $valid_time;
    var $interval;
    var $confirm_time;

    /* 构造函数 */
    function __construct()
    {
         $this->Seller_returnsApp();
    }

    function Seller_returnsApp()
    {
        parent::__construct();

        $this->_order_mod =& m('order');
        $this->_order_extm_mod =& m('orderextm');
		$this->_order_goods_mod =& m('ordergoods');
		$this->_order_log_mod =& m('orderlog');
		$this->_returns_mod =& m('returns');
        $this->_returns_log_mod =& m('returnslog');
        $this->_user_safety_mod =& m('usersafety');
        $this->_address_mod =& m('selleraddress');
        $this->valid_time = gmtime()-15*3600*24;
        $this->interval = 5 * 24 * 3600 ;//默认15天
        $this->confirm_time = 10 * 24 * 3600 ;//默认10天
    }
    
    
    /**
     *    退货退款记录
     *    @author    yanghj 2014.8.5
     */
    function index()
	{
	    if(isset($_GET['returns_type']) && intval($_GET['returns_type'])>0 && intval($_GET['returns_type'])<5)
        {
            $returns_type = intval($_GET['returns_type']);
        }
        else
        {
             $returns_type = 2;
        }
        $cfg_returns = $this->_get_cfg_msg();
	    $page = $this->_get_page(10);
		$returns = $this->_returns_mod->find(array(
		'fields'        => "this.returns_sn, this.type, this.status, this.add_time, this.returns_amount, order.order_id, order.order_sn, order.status as order_status,ordergoods.goods_id,ordergoods.goods_name,ordergoods.specification,ordergoods.quantity as goods_quantity",
		'conditions'    => " returns.type = {$returns_type} AND returns.seller_id=" . $this->visitor->get('user_id'),
		'join'          => 'belongs_to_order,belongs_to_ordergoods',
        'order'         => 'returns_id DESC',
        'count'         => true,
		'limit'         => $page['limit'],
		));
        if($returns)
        {
            foreach($returns as $key => $val)
            {
                $returns[$key]['returns_status'] = $cfg_returns['status'][$val['status']][$val['type']]['msg_1'];//退货退款状态提示
            }
            
        }

		$this->_curlocal(LANG::get('seller_center'), 'index.php?app=seller',
		LANG::get('my_sales_return'), 'index.php?app=seller_returns','退货/退款列表');

		/* 当前用户中心菜单 */
		$this->_curitem('my_sales_return');
		$this->_curmenu('returns_list');
		$this->_config_seo('title', Lang::get('seller_center') . ' - ' . Lang::get('my_sales_return'));
        
        $page['item_count'] = $this->_returns_mod->getCount();
        $this->_format_page($page);
		$this->assign('returns_list', $returns);	
        $this->assign('returns_type', $returns_type);		
		$this->assign('page_info', $page);
		$this->display('seller_returns.index.html');
	}
    
    /**
     *    同意退货退款
     *    @author    yanghj 2014.8.6
     */
    function agree()
	{
	    $returns_id = isset($_GET['returns_id']) ? intval($_GET['returns_id']) : 0;
        if(!$returns_id)
        {
            $this->show_warning('failure_error','back_index', 'index.php');
			return;
        }
        /*用户支付密码*/
        $user_pay_password = $this->_user_safety_mod->getOne("SELECT pay_password FROM {$this->_user_safety_mod->table} WHERE user_id = ". $this->visitor->get('user_id'));
        if(empty($user_pay_password))
        {
            $this->show_warning('请先设置支付密码再操作!','立刻设置支付密码', 'index.php?app=account_security&act=authen_verify&mode=set_pay_password&from=seller');
			return;
        }
        
        $returns_info = $this->_returns_mod->get(array(
		'fields'        => "this.*, order.order_sn, order.status as order_status,ordergoods.goods_id,ordergoods.goods_name,ordergoods.specification,ordergoods.goods_image,ordergoods.price,ordergoods.quantity  as goods_quantity",
		'conditions'    => "returns_id={$returns_id} AND returns.seller_id=" . $this->visitor->get('user_id'),
		'join'          => 'belongs_to_order,belongs_to_ordergoods',
		));
        if($returns_info['status'] !=1 && $returns_info['status'] !=3 && $returns_info['status'] !=5  && $returns_info['status'] !=4)
        {
            $this->show_warning('failure_error','back_index', 'index.php');
		    return;
        }
        $cfg_returns = $this->_get_cfg_msg();
  
	    if (!IS_POST)
		{   
		    $tpl = 'seller_returns.agree.html';                       
            if($returns_info['type']==2 && ($returns_info['status'] ==1 || $returns_info['status'] ==4))
            {
                $address_list = $this->_address_mod->find(array(
        		'fields'        => "addr_id,consignee,region_name,address,phone_tel,phone_mob",
        		'conditions'    => "type=1 AND user_id=" . $this->visitor->get('user_id'),
        		'order'         => 'is_deafult,addr_id DESC',
        		));
                if(!$address_list)
                {
                    $this->show_warning('你还没有填写退货地址','立刻填写退货地址', 'index.php?app=seller_address&act=returns');
		            return;
                }
                $tpl = 'seller_returns.agree1.html';
                $this->assign('address_list', $address_list);
                
            }
            /*退货退款日志*/
            $returns_log = $this->_returns_log_mod->find(array(		
    		'conditions'    => "returns_id={$returns_id} ",
            'order'         => 'log_time DESC',
    		));
            $this->import_resource(array(
    			'script' => 'jquery.plugins/jquery.validate.js,jquery.plugins/additional-methods.js',
    			));
    		$this->_curlocal(LANG::get('seller_center'), 'index.php?app=seller',
    		LANG::get('my_sales_return'), 'index.php?app=seller_returns','同意退货/退款');
    
    		/* 当前用户中心菜单 */
    		$this->_curitem('my_sales_return');
    		$this->_curmenu('returns_list');
    		$this->_config_seo('title', Lang::get('seller_center') . ' - ' . Lang::get('my_sales_return'));
            $this->assign('returns', $returns_info);
		    $this->assign('returns_log',$returns_log);
            $this->assign('report_reason', $cfg_returns['report_reason']);
    		$this->display($tpl);		  
		}
        else
        {
            $agree_type = isset($_POST['agree_type']) ? intval($_POST['agree_type']) : 0;
            
            if(!$agree_type || $agree_type > 2)
            {
                $this->show_warning('failure_error','back_index', 'index.php');
    		    return;
            }
            
            /*支付密码确认*/
            if($agree_type == 1)
            {
                $password = trim($_POST['password']);
                $report_reason = trim($_POST['report_reason']);
                if($user_pay_password != md5(md5($password,true)))
                {
                    $this->show_warning('支付密码不正确!');
        		    return;
                }
                if(empty($report_reason))
                {
                    $this->show_warning('请选择退款原因!');
        		    return;
                }
                $data = array(
        		'status'    => 7,
                'report_reason'  => $report_reason,
                'confirm_time'   => gmtime(),
    		    );
                $log_data = array(
        		'returns_id' => $returns_id,
        		'operator'   => $this->visitor->get('user_name'),
        		'remark'     => $cfg_returns['status']['7'][$returns_info['type']]['msg_3'],
                'log_time'   => gmtime(),
        		);
                
            }
            /*发送退货地址给卖家*/
            if($agree_type == 2)
            {
                $data = array(
        		'status'    => 3,
                'agree_time'   => gmtime(),
                'addr_id' => (int)$_POST['address_options'],
                'agree_msg' => html_script($_POST['message']),
    		    );
                
                $address = $this->_address_mod->get(array(
        		'fields'        => "addr_id,consignee,region_name,address,phone_tel,phone_mob",
        		'conditions'    => "addr_id = {$data['addr_id']}",
        		));
                
                $log_data = array(
        		'returns_id' => $returns_id,
        		'operator'   => $this->visitor->get('user_name'),
        		'remark'     => $cfg_returns['status']['3'][$returns_info['type']]['msg_3'].'留言:'.$data['agree_msg'].'，收件人:'.$address['consignee'].'，收货地址:'.$address['region_name'].' '.$address['address'].'，联系电话:'.$address['phone_mob'],
                'log_time'   => gmtime(),
        		);
                
                $this->_returns_mod->send_returns_email($returns_info['buyer_id'],$returns_id,6);//发送邮件给买家;
                
            }
                                 
            /*修改退货退款状态*/
            $this->_returns_mod->edit($returns_id, $data);
            if ($this->_returns_mod->has_error())
    		{
    			$this->show_warning($this->_returns_mod->get_error());
    			return;
    		}                                   
        
            /*添加到退货退款日志表*/
            if (!($this->_returns_log_mod->add($log_data)))
            {
                $this->show_warning($this->_returns_log_mod->get_error());    
                return;
            }
            $this->show_message('操作成功!','查看详细','index.php?app=seller_returns&act=view&returns_id='.$returns_id);           
        }
	    
	}
    
    /**
     *    卖家申请万菱介入
     *    @author    yanghj 2014.8.8
     */
    function intervene()
	{
	   exit;
	    $returns_id = isset($_GET['returns_id']) ? intval($_GET['returns_id']) : 0;
        if(!$returns_id)
        {
            $this->show_warning('failure_error','back_index', 'index.php');
			return;
        }
        $returns_data = $this->_returns_mod->get(array(
		'fields'        => "returns_id,type",
		'conditions'    => "returns_id={$returns_id} AND  buyer_id=" . $this->visitor->get('user_id'),
		));
        if(!$returns_data)
        {
            $this->show_warning('failure_error','back_index', 'index.php');
			return;
        }

        $cfg_returns = $this->_get_cfg_msg();      
	    $data = array(
		'status'    => 2,
        'finished_time'   => gmtime(),
		);
        
        /*修改退货退款状态*/
        $this->_returns_mod->edit($returns_id, $data);
        if ($this->_returns_mod->has_error())
		{
			$this->show_warning($this->_returns_mod->get_error());
			return;
		}                        
        $log_data = array(
		'returns_id' => $returns_id,
		'operator'   => $this->visitor->get('user_name'),
		'remark'     => $cfg_returns['status']['2'][$returns_data['type']]['msg_3'],
        'log_time'   => gmtime(),
		);
        
        /*添加到退货退款日志表*/
        if (!($this->_returns_log_mod->add($log_data)))
        {
            $this->show_warning($this->_returns_log_mod->get_error());    
            return;
        }
        $this->show_message('操作成功!','查看详细','index.php?app=seller_returns&act=view&returns_id='.$returns_id);
	}
    
    
    /**
     *    拒绝买家退货退款申请
     *    @author    yanghj 2014.8.6
     */
    function refuse()
	{
	    $returns_id = isset($_GET['returns_id']) ? intval($_GET['returns_id']) : 0;
        if(!$returns_id)
        {
            $this->show_warning('failure_error','back_index', 'index.php');
			return;
        }
        $returns_info = $this->_returns_mod->get(array(
		'fields'        => "this.*, order.order_sn, order.status as order_status,ordergoods.goods_id,ordergoods.goods_name,ordergoods.specification,ordergoods.goods_image,ordergoods.price,ordergoods.quantity  as goods_quantity",
		'conditions'    => "returns_id={$returns_id} AND returns.seller_id=" . $this->visitor->get('user_id'),
		'join'          => 'belongs_to_order,belongs_to_ordergoods',
		));
        if(!$returns_info || $returns_info['status'] !=1 && $returns_info['status'] !=5 )
        {
            $this->show_warning('failure_error','back_index', 'index.php');
			return;
        }
        $cfg_returns = $this->_get_cfg_msg();   
        if(!IS_POST)
        {
            /*退货退款日志*/
            $returns_log = $this->_returns_log_mod->find(array(		
    		'conditions'    => "returns_id={$returns_id} ",
            'order'         => 'log_time DESC',
    		));
            $this->import_resource(array(
    			'script' => 'jquery.plugins/jquery.validate.js,jquery.plugins/additional-methods.js',
    			));
    		$this->_curlocal(LANG::get('seller_center'), 'index.php?app=seller',
    		LANG::get('my_sales_return'), 'index.php?app=seller_returns','拒绝退货/退款');
    
    		/* 当前用户中心菜单 */
    		$this->_curitem('my_sales_return');
    		$this->_curmenu('returns_list');
    		$this->_config_seo('title', Lang::get('seller_center') . ' - ' . Lang::get('my_sales_return'));
            $this->assign('returns', $returns_info);
		    $this->assign('returns_log',$returns_log);
            $this->assign('returns_type_arr', $cfg_returns['type']);   
    		$this->display('seller_returns.refuse.html');
            
        }
        else
        {

            $upload_img = $this->_uploadify_img();
            if($upload_img['state'] === false )
            {
                 $this->show_warning($upload_img['msg']);
		         return;                    
            }
            
            $data = array(
			'status'   => 4,
            'refuse_time'   => gmtime(),                
            'refuse_explain'   => html_script($_POST['message']),
            'refuse_img'   => !empty($upload_img['file_url']) ? implode('|',$upload_img['file_url']) : '',
			);

            /*修改退货退款状态*/
            $this->_returns_mod->edit($returns_id, $data);
            if ($this->_returns_mod->has_error())
    		{
    			$this->show_warning($this->_returns_mod->get_error());
    			return;
    		} 
                                   
            $log_data = array(
    		'returns_id' => $returns_id,
    		'operator'   => $this->visitor->get('user_name'),
    		'remark'     => $cfg_returns['status']['4'][$returns_info['type']]['msg_3'].'拒绝原因:'.$data['refuse_explain'],
            'log_time'   => gmtime(),
    		);
            
            /*添加到退货退款日志表*/
            if (!($this->_returns_log_mod->add($log_data)))
            {
                $this->show_warning($this->_returns_log_mod->get_error());    
                return;
            }
            
            $this->_returns_mod->send_returns_email($returns_info['buyer_id'],$returns_id,5);//发送邮件给买家;
            
            $this->show_message('操作成功!','查看详细','index.php?app=seller_returns&act=view&returns_id='.$returns_id);
            
        }   
	    
	}



	/**
     *    查看详情
     *    @author    yanghj 2014.8.1
     */
	function view()
	{
		$returns_id = isset($_GET['returns_id']) ? intval($_GET['returns_id']) : 0;
        if(!$returns_id)
        {
            $this->show_warning('failure_error','back_index', 'index.php');
			return;
        }
        $left_time = 0;//倒计时间,以秒为单位
        $cfg_returns = $this->_get_cfg_msg(); 
		$returns_info = $this->_returns_mod->get(array(
		'fields'        => "this.*, order.order_sn, order.status as order_status,ordergoods.goods_id,ordergoods.goods_name,ordergoods.specification,ordergoods.goods_image,ordergoods.price,ordergoods.quantity as goods_quantity",
		'conditions'    => "returns_id={$returns_id} AND returns.seller_id=" . $this->visitor->get('user_id'),
		'join'          => 'belongs_to_order,belongs_to_ordergoods',
		));
        switch ($returns_info['status'])
        {
            case '1': //申请
                $left_time = $returns_info['add_time']+$this->interval-gmtime();             
                break;
            case '3': //卖家同意退货退款
                $left_time = $returns_info['agree_time']+$this->interval-gmtime();             
                break;
            case '4': //卖家拒绝退货退款
                $left_time = $returns_info['refuse_time']+$this->interval-gmtime();             
                break;
            case '5': //买家退货
                $left_time = $returns_info['shipping_time']+$this->confirm_time-gmtime();             
                break;    
            default:
                
                break;    
            
        }
		if (!$returns_info)
		{
			$this->show_warning('没有申请记录!');

			return;
		}
        if($returns_info['returns_img'])
        {
            $returns_info['returns_img'] = explode('|',$returns_info['returns_img']);
        }
        if($returns_info['refuse_img'])
        {
            $returns_info['refuse_img'] = explode('|',$returns_info['refuse_img']);
        }
        $returns_info['returns_status'] = $cfg_returns['status'][$returns_info['status']][$returns_info['type']]['msg_2'];//退货退款状态提示
        $returns_info['left_time'] = $left_time;//剩余时间
        $returns_log = $this->_returns_log_mod->find(array(		
		'conditions'    => "returns_id={$returns_id} ",
        'order'         => 'log_time DESC',
		));
       // var_dump($returns_info);
        
		$this->_curlocal(LANG::get('seller_center'), 'index.php?app=seller',
		LANG::get('my_sales_return'), 'index.php?app=seller_returns','详情');

		/* 当前用户中心菜单 */
		$this->_curitem('my_sales_return');
		$this->_curmenu('returns_list');
		$this->_config_seo('title', Lang::get('seller_center') . ' - ' . Lang::get('my_sales_return'));
		$this->assign('returns', $returns_info);
		$this->assign('returns_log',$returns_log);
		$this->display('seller_returns.view.html');
	}
    
    /**
     * 上传图片
     *
     * @return mix false表示上传失败,空串表示没有上传,string表示上传文件地址
     */
	function _uploadify_img()
	{
	    $rs = array('state'=>false, 'msg'=>'', 'file_url'=>array());
        for($i=1;$i<6;$i++)
        {
            
            $file_src = 'file_'.$i;
            $file = $_FILES[$file_src];
            if(!isset($file))
            {
                break;                
            }
            if ($file['error'] != UPLOAD_ERR_OK)
    		{
    		    $rs['state'] = true;
    		    $rs['msg'] = '请选择上传的图片';
                return $rs;
    		}
    		import('uploader.lib');
    		$uploader = new Uploader();
    		$uploader->allowed_type(IMAGE_FILE_TYPE);
            $uploader->allowed_size(512000);
    		$uploader->addFile($file);
    		if ($uploader->file_info() === false)
    		{
    		    $rs['state'] = false;
    			$rs['msg'] = '图片的格式不对或者大小超过了500kb';
                return $rs;	
    		}
    		$uploader->root_dir(ROOT_PATH);
            $file_dir = 'data/files/returns/'.$this->visitor->get('user_id');
            $file_url = $uploader->save($file_dir, $uploader->random_filename());
            if(file_exists(ROOT_PATH.'/'.$file_url) && $file_url)
            {
                 $rs['state'] = true;
                 $rs['file_url'][] = $file_url;       
            }
            else
            { 
                 $rs['state'] = false;
                 $rs['msg'] = '上传失败';        			
            }        
        }
        return $rs;			
	}
    
    /**
     * 生成退货退款单号:年月日时分秒+4位随机数字
     * @param int $len  长度
     */
	function _get_returns_code($len=4)
	{
		$rnd = mt_rand(("1".sprintf("%0".($len-1)."d", 0))+0,("1".sprintf("%0".$len."d", 0))-1);
		$var = sprintf("%0".$len."d", $rnd);
		return date('YmdHis').$var;
	}
    
    /**
     * 买家退货退款配置信息
     */
    function _get_cfg_msg()
    {
       //状态 0.无效 1.申请 2.取消  3.卖家同意 4.卖家拒绝  5.买家发货  6.万菱介入 7.确认 8.成功 -1.关闭
       //类型 1.退款  2.退货退款  3.换货 
        $cfg_returns = array(
        'type' =>array(
            '1' => '退款',
            '2' => '退货退款',
            '3' => '换货',
        ),
        
        /*后台报表用到的退款原因 */
        'report_reason' =>array(
        '商家' =>array(
            '1' => '产品质量',
            '2' => '假货',
            '3' => '产品味道',
            '4' => '订单串货',
            '5' => '内包装破损',
            '6' => '产品错漏发多发',
            '7' => '产品破损',
            '8' => '生产日期',
            '9' => '客服',
            '10' => '不开发票',
            '11' => '缺货',
            '12' => '未按约定时间发货',
            '13' => '卖家要求加价',
            '14' => '商品需要维修',
        ),
        '快递' =>array(
            '1' => '丢失',
            '2' => '非本人签收',
            '3' => '客户拒收',
            '4' => '快递超区',
            '5' => '快递服务差',
            '6' => '派送错误',
            '7' => '派送延迟',
            '8' => '收货信息变更',
            '9' => '外包装破损',
            '10' => '物流信息更新慢',
            '11' => '电话联系不上客户',
        ), 
        '运营' =>array(
            '1' => '活动价格变',
            '2' => '宝贝页面描述',
            '3' => '赠品错漏发',
            '4' => '收到商品与网页描述不符',
        ),
        '客户' =>array(
            '1' => '无理由退货',
            '2' => '拍错了',
            '3' => '不想要了/不喜欢',
            '4' => '效果不好/与期望不符',
            '5' => '找到比原商品更低价的价格',
        ),  
        ),
       
        /*1.退款  2.退货退款  3.换货 原因 */
        'reason' =>array(
        '1' =>array(
            '1' => '退运费',
            '2' => '不想要了/拍错了',
            '3' => '缺货',
            '4' => '未按约定时间发货',
            '5' => '卖家要求加价',
            '6' => '协商一致退款',
            '7' => '没有收到货',
            '8' => '其他',
        ),
        '2' =>array(
            '1' => '收到商品破损',
            '2' => '商品错发/漏发',
            '3' => '商品需要维修',
            '4' => '收到商品与描述不符',
            '5' => '商品有质量问题',
            '6' => '收到假货',
            '7' => '不想要了',
            '8' => '其他',
        ), 
        '3' =>array(
            '1' => '代购商品不符问题',
            '2' => '认为是假货',
            '3' => '效果不好/不喜欢',
            '4' => '发货问题',
            '5' => '空包裹、商品破损、有污渍',
            '6' => '其他',
        ),  
        ),
        
        /*1.退款  2.退货退款  3.换货 状态提示信息 */
        'status' => array(
        '0' => array(
               '1'=>array('msg_1'=>'退款关闭','msg_2'=>'退款关闭。','msg_3'=>'买家取消退款申请。'),
               '2'=>array('msg_1'=>'退款关闭','msg_2'=>'退款关闭。','msg_3'=>'买家取消退款申请。'),
               '3'=>array('msg_1'=>'退款关闭','msg_2'=>'退款关闭。','msg_3'=>'买家取消退款申请。')
         ),
        '1' => array(
               '1'=>array('msg_1'=>'请处理退款','msg_2'=>'买家申请退款，等您处理。','msg_3'=>''),
               '2'=>array('msg_1'=>'请处理退货','msg_2'=>'买家申请退货退款，等您处理。','msg_3'=>''),
               '3'=>array('msg_1'=>'请处理退款','msg_2'=>'买家申请退货退款，等您处理。','msg_3'=>'')
         ),
        '2' => array(
               '1'=>array('msg_1'=>'退款关闭','msg_2'=>'退款关闭。','msg_3'=>''),
               '2'=>array('msg_1'=>'退货退款关闭','msg_2'=>'退货退款关闭。','msg_3'=>''),
               '3'=>array('msg_1'=>'退款关闭','msg_2'=>'退款关闭。','msg_3'=>'')
         ),
        '3' => array(
               '1'=>array('msg_1'=>'','msg_2'=>'','msg_3'=>''),
               '2'=>array('msg_1'=>'等待买家退货','msg_2'=>'请您等待买家退货。','msg_3'=>'卖家同意退货退款申请。'),
               '3'=>array('msg_1'=>'等待买家退货','msg_2'=>'请您等待买家退货。','msg_3'=>'卖家同意退货退款申请。')
         ),
        '4' => array(
               '1'=>array('msg_1'=>'等买家处理','msg_2'=>'卖家拒绝退款，等待买家处理','msg_3'=>'卖家拒绝退款申请。'),
               '2'=>array('msg_1'=>'等买家处理','msg_2'=>'卖家拒绝退货退款，等待买家处理','msg_3'=>'卖家拒绝退货退款申请。'),
               '3'=>array('msg_1'=>'等买家处理','msg_2'=>'卖家拒绝退款，等待买家处理','msg_3'=>'卖家拒绝退货退款申请。')
         ),
        '5' => array(
               '1'=>array('msg_1'=>'','msg_2'=>'','msg_3'=>''),
               '2'=>array('msg_1'=>'请退款','msg_2'=>'买家已发出退货，等您收货并退款。','msg_3'=>''),
               '3'=>array('msg_1'=>'请退款','msg_2'=>'买家已发出退货，等您收货并退款。','msg_3'=>'')
         ),
        '6' => array(
               '1'=>array('msg_1'=>'万菱介入中','msg_2'=>'万菱介入中','msg_3'=>'卖家申请万菱介入。'),
               '2'=>array('msg_1'=>'万菱介入中','msg_2'=>'万菱介入中','msg_3'=>'卖家申请万菱介入。'),
               '3'=>array('msg_1'=>'万菱介入中','msg_2'=>'万菱介入中','msg_3'=>'卖家申请万菱介入。')
         ),
        '7' => array(
               '1'=>array('msg_1'=>'退款转账中','msg_2'=>'您已同意退款。','msg_3'=>'卖家同意退款。'),
               '2'=>array('msg_1'=>'退款转账中','msg_2'=>'您已同意退款。','msg_3'=>'卖家同意退款。'),
               '3'=>array('msg_1'=>'退款转账中','msg_2'=>'您已同意退款。','msg_3'=>'卖家同意退款。')
         ),
        '8' => array(
               '1'=>array('msg_1'=>'退款成功','msg_2'=>'退款成功。','msg_3'=>'退款已成功退回买家账户。'),
               '2'=>array('msg_1'=>'退款成功','msg_2'=>'退款成功。','msg_3'=>'退款已成功退回买家账户。'),
               '3'=>array('msg_1'=>'退款成功','msg_2'=>'退款成功。','msg_3'=>'退款已成功退回买家账户。')
         ),
        '-1'=> array(
               '1'=>array('msg_1'=>'退货关闭','msg_2'=>'退货关闭。','msg_3'=>'买家超时未响应。'),
               '2'=>array('msg_1'=>'退货关闭','msg_2'=>'退货关闭。','msg_3'=>'买家超时未响应。'),
               '3'=>array('msg_1'=>'退货关闭','msg_2'=>'退货关闭。','msg_3'=>'买家超时未响应。')
         ),
        ),);
        return $cfg_returns;
    }

}

?>
